﻿/*
*操作按钮JS
*
*CreateBy:   Black
*
*CreateDate: 2009-07-30
*
*
*
* 
/*--------------------------------------------------------------------------*/
   //创建浏览器对象
   var ActionXmlhttp;
   document.write("<div style='display:none; width:100%' id=\"ActionDiv\" name=\"ActionDiv\" ></div>");
    //type调用的DIV的类型
    function ActionClick(Type)
    {
      ActionNameAuthentication(Type);
    }
             function ActionCreateXMLHttpRequest() 
             { 
                if (window.XMLHttpRequest) 
                { 
                  ActionXmlhttp = new XMLHttpRequest(); 
                    if (Operatexmlhttp.overrideMimeType) 
                    { 
                      ActionXmlhttp.overrideMimeType("text/xml"); 
                    } 
                } 
                else if (window.ActiveXObject) 
                { 
                    var activexName = ["MSXML2.XMLHTTP","Microsoft.XMLHTTP"]; 
                    for (var i = 0; i < activexName.length; i++) 
                    { 
                        try
                        { 
                          ActionXmlhttp = new ActiveXObject(activexName[i]); 
                            break; 
                        } 
                        catch(e)
                        { 
                        } 
                    } 
                } 
              }

                //异步请求
                function ActionNameAuthentication(type)
                 {
                  var Url = "../Common/ActionAjax.aspx?TYPE="+type;                
                  ActionCreateXMLHttpRequest();
                  ActionXmlhttp.onreadystatechange =ActionhandleStateChange;
                  ActionXmlhttp.open("GET", Url, true);
                  ActionXmlhttp.send(null);
                }
                //返回数据
                function ActionhandleStateChange() 
                {
                    if (Operatexmlhttp.readyState == 4) {
                        if (Operatexmlhttp.status == 200) {
                         document.getElementById("ActionDiv").innerHTML =Actionxmlhttp.responseText;
                        }
                    }
                }